package net.huashitong.synthetical.newSupervision.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.synthetical.newSupervision.dao.TaskMessageDao;
import net.huashitong.synthetical.newSupervision.entity.TaskMessage;
import net.huashitong.synthetical.newSupervision.filter.TaskMessageFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: ling
 * Date: 2019/7/16
 * Time: 18:51
 * To change this template use File | Settings | File Templates.
 * Description:
 */
@Service
public class TaskMessageService extends StringPKService<TaskMessage>{

    @Autowired
    private TaskMessageDao taskMessageDao;

    @Autowired
    private SysTableService tableService;

    @Override
    protected BaseDao<TaskMessage, String> getDao() {
        return taskMessageDao;
    }

    @Override
    protected void beforeSave(TaskMessage obj) {
       obj.setSysId(tableService.updateMaxSysId("t_task_message",null ));
    }

    public List<TaskMessage> queryFilter(TaskMessageFilter filter) {
        return taskMessageDao.queryFilter(filter);
    }
}
